package com.arpa.wms.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 期初明细 实体
 * @author jinss
 * @date 2020-09-24 13:34:11
 **/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("wms_initialization_item")
@ApiModel(value="InitializationItem对象", description="期初明细")
public class InitializationItem extends BasicEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "数据标识")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "所属机构")
    @TableField("group_code")
    private String groupCode;

    @ApiModelProperty(value = "期初主单号")
    @TableField("initialization_code")
    private String initializationCode;

    @ApiModelProperty(value = "入驻商")
    @TableField("shipment_code")
    @NotBlank(message = "货主不能为空", groups = {Initialization.Save.class, Initialization.Update.class})
    private String shipmentCode;

    @ApiModelProperty(value = "仓库")
    @TableField("warehouse_code")
    private String warehouseCode;

    @ApiModelProperty(value = "库区")
    @TableField("warehouse_space_code")
    @NotBlank(message = "库区不能为空", groups = {Initialization.Save.class, Initialization.Update.class})
    private String warehouseSpaceCode;

    @ApiModelProperty(value = "库位")
    @TableField("location")
    @NotBlank(message = "库位不能为空", groups = {Initialization.Save.class, Initialization.Update.class})
    private String location;

    @ApiModelProperty(value = "商品code")
    @TableField("goods_code")
    @NotBlank(message = "商品不能为空", groups = {Initialization.Save.class, Initialization.Update.class})
    private String goodsCode;

    @ApiModelProperty(value = "商品编码")
    @TableField("good_code")
    @NotBlank(message = "商品编码不能为空", groups = {Initialization.Save.class, Initialization.Update.class})
    private String goodCode;

    @ApiModelProperty(value = "商品条码")
    @TableField("goods_bar_code")
    @NotBlank(message = "商品条码不能为空", groups = {Initialization.Save.class, Initialization.Update.class})
    private String goodsBarCode;

    @ApiModelProperty(value = "商品名称")
    @TableField("goods_name")
    private String goodsName;

    @ApiModelProperty(value = "单位")
    @TableField("goods_unit")
    @NotBlank(message = "单位不能为空", groups = {Initialization.Save.class, Initialization.Update.class})
    private String goodsUnit;

    @ApiModelProperty(value = "单位数量")
    @TableField("unit_quantity")
    @Min(value = 1, message = "期初单明细数量不能小于等于0", groups = {Initialization.Save.class, Initialization.Update.class})
    @Digits(integer = 20, fraction = 6, message = "期初单明细数量的值超出了允许范围(只允许在20位整数和6位小数范围内)", groups = {Initialization.Save.class, Initialization.Update.class})
    private BigDecimal unitQuantity;

    @ApiModelProperty(value = "数量")
    @TableField("quantity")
    private BigDecimal quantity;

    @ApiModelProperty(value = "库存状态")
    @TableField("goods_status")
    @NotBlank(message = "库存状态不能为空", groups = {Initialization.Save.class, Initialization.Update.class})
    private String goodsStatus;

    @ApiModelProperty(value = "库存状态名称")
    @TableField("goods_status_name")
    private String goodsStatusName;

    @ApiModelProperty(value = "生产日期")
    @TableField("gmt_manufacture")
    private LocalDateTime gmtManufacture;

    @ApiModelProperty(value = "过期日期")
    @TableField("gmt_expire")
    private LocalDateTime gmtExpire;

    @ApiModelProperty(value = "供应商")
    @TableField("supplier_code")
    private String supplierCode;

    @ApiModelProperty(value = "序列号")
    @TableField("serial_number")
    private String serialNumber;

    @ApiModelProperty(value = "批次规则")
    @TableField("lot_number")
    private String lotNumber;

    @ApiModelProperty(value = "是否可发货")
    @TableField("is_consignment")
    private String isConsignment;

    @ApiModelProperty(value = "扩展1")
    @TableField("extend_one")
    private String extendOne;

    @ApiModelProperty(value = "扩展2")
    @TableField("extend_two")
    private String extendTwo;

    @ApiModelProperty(value = "扩展3")
    @TableField("extend_three")
    private BigDecimal extendThree;

    @ApiModelProperty(value = "扩展4")
    @TableField("extend_four")
    private BigDecimal extendFour;

    @ApiModelProperty(value = "扩展5")
    @TableField("extend_five")
    private LocalDateTime extendFive;

    @ApiModelProperty(value = "扩展6")
    @TableField("extend_six")
    private LocalDateTime extendSix;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    @Length(max = 255, message = "领用单明细备注长度不能大于255个字符", groups = {Initialization.Save.class, Initialization.Update.class})
    private String remarks;

    @ApiModelProperty(value = "货主名称")
    @TableField("shipment_name")
    private String shipmentName;

    @ApiModelProperty(value = "仓库名称")
    @TableField("warehouse_name")
    private String warehouseName;

    @ApiModelProperty(value = "库区名称")
    @TableField("warehouse_space_name")
    private String warehouseSpaceName;

    @ApiModelProperty(value = "库位名称")
    @TableField("location_name")
    private String locationName;

    @ApiModelProperty(value = "单位名称")
    @TableField("goods_unit_name")
    private String goodsUnitName;

    @ApiModelProperty(value = "供应商名称")
    @TableField("supplier_name")
    private String supplierName;

    @ApiModelProperty(value = "供应商")
    @TableField("supplier")
    private String supplier;

    @ApiModelProperty(value = "基本单位")
    @TableField("basic_unit")
    @NotBlank(message = "基本单位不能为空", groups = {Initialization.Save.class, Initialization.Update.class})
    private String basicUnit;

    @ApiModelProperty(value = "基本单位名称")
    @TableField("basic_unit_name")
    private String basicUnitName;

    @ApiModelProperty(value = "基本单位转换数量")
    @TableField("basic_quantity")
    private BigDecimal basicQuantity;

    @ApiModelProperty(value = "存货日期")
    @TableField("gmt_stock")
    private LocalDateTime gmtStock;


}
